﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VacationTeacherReport.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Report.VacationTeacherReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/Util.js"></script>
    
    <script language="javascript" type="text/javascript">
    var IsSuper = <%=bIsSuper?1:0 %>;

    //在文本框中按回车快捷触发查询
    function submitQuery() {
        if (event.keyCode == 13) {
            event.keyCode = 9;
            event.returnValue = false;
            document.getElementById('btnQuery').click();
        }
    }

    function TopClick() {
        document.getElementById("txt_Go").value = 1;
        document.getElementById("btnQuery").click();
        document.getElementById("lbl_ToPage").innerHTML = 1;
    }

    function UpClick() {
        var txt = document.getElementById("txt_Go");
        if (parseInt(txt.value) > 1) {
            txt.value = parseInt(txt.value) - 1;
            document.getElementById("btnQuery").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }
    }

    function NextClick() {
        var txt = document.getElementById("txt_Go");
        if (parseInt(txt.value) < parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
            txt.value = parseInt(txt.value) + 1;
            document.getElementById("btnQuery").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }
    }

    function EndClick() {
        document.getElementById("txt_Go").value = document.getElementById("lbl_PageCount").innerHTML;
        document.getElementById("btnQuery").click();
        document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
    }

    function GoClick() {
        var txt = document.getElementById("txt_Go");
        if (parseInt(txt.value) >= parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
            txt.value = document.getElementById("lbl_PageCount").innerHTML;
        }
        if (parseInt(txt.value) <= 1) {
            txt.value = 1;
        }
        if (isNaN(parseInt(txt.value))) {
            txt.value = 1;
        }
        document.getElementById("btnQuery").click();
        var patrn = /^[1-9]\d*$/;
        if (patrn.exec(txt.value)) {
            document.getElementById("lbl_ToPage").innerHTML = txt.value;
        }

    }

    function AddSumRow(SumAmountIssued, SumAmountIssuedPlus, SumHolidayWork, SumAmountActual) {
        var table = document.getElementById("reportTable");
        var tr = table.insertRow();

        var td1 = tr.insertCell();
        td1.colSpan = 2;
        td1.innerText = "合计：";
        td1.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";

        var td2 = tr.insertCell();
        td2.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";
        td2.innerText = SumAmountIssued;

        var td3 = tr.insertCell();
        td3.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";
        td3.innerText = SumAmountIssuedPlus;

        var td4 = tr.insertCell();
        td4.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";
        td4.innerText = SumHolidayWork;

        var td5 = tr.insertCell();
        td5.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";
        td5.innerText = SumAmountActual;

        var td6 = tr.insertCell();
        td6.innerText = "";
    }

    function Load() {
        if(IsSuper == "0"){
            document.getElementById("sQuery").style.display="none";
            document.getElementById("ddlQueryType").style.display="none";
            document.getElementById("queryKeyWord").style.display="none";
            document.getElementById("dPage").style.display="none";
        }
        else{
            document.getElementById("sQuery").style.display="";
            document.getElementById("ddlQueryType").style.display="";
            document.getElementById("queryKeyWord").style.display="";
            document.getElementById("dPage").style.display="";
        }
    }
    </script>
</head>
<body onload="Load();">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <div class="mainWarp">
        <div class="pageBody">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
            <table width="98%">
                <tr>
                    <td style="text-align: left; width: 40%;padding-top:5px;">
                        年月：<asp:DropDownList ID="ddlYearMonth" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right; width: 40%;padding-top:5px;">
                        <span id="sQuery">查询方式:</span><asp:DropDownList ID="ddlQueryType" runat="server" 
                            onselectedindexchanged="ddlQueryType_SelectedIndexChanged" AutoPostBack="True">
                        </asp:DropDownList>
                        <asp:TextBox ID="queryKeyWord" runat="server"></asp:TextBox>
                        <asp:Button ID="btnQuery" runat="server" Text="查询" class="commonBut"
                            onclick="btnQuery_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="height: 20px">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="left">
                        
                                <asp:Repeater ID="rpt_TeacherReport" runat="server">
                                    <HeaderTemplate>
                                        <table id="reportTable" style="width: 100%;table-layout: fixed" class="useList" border="0" cellpadding="0"
                                            cellspacing="1">
                                            <tr class="tableTitle">
                                                <th style="width:12%">
                                                    工号
                                                </th>
                                                <th style="width:12%">
                                                    姓名
                                                </th>
                                                <th style="width:12%">
                                                    应发金额
                                                </th>
                                                <th style="width:15%">
                                                    扣队奖教学奖后金额
                                                </th>
                                                <th style="width:12%">
                                                    假期值班
                                                </th>
                                                <th style="width:12%">
                                                    实发金额
                                                </th>
                                                <th style="width:25%;">
                                                    备注
                                                </th>
                                            </tr>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr>
                                            <td style="text-align: left;padding-left: 5px;">
                                                <%# DataBinder.Eval(Container.DataItem,"TeachCode")%>
                                            </td>
                                            <td style="text-align: left;padding-left: 5px;">
                                                <%# DataBinder.Eval(Container.DataItem, "TeachName")%>
                                            </td>
                                            <td style="text-align: right;padding-right: 5px;">
                                                <%# DataBinder.Eval(Container.DataItem, "AmountIssued")%>
                                            </td>
                                            <td style="text-align: right;padding-right: 5px;">
                                                <%# GetVacaMoney(Eval("AmountIssued"))%>
                                            </td>
                                            <td style="text-align: right;padding-right: 5px;">
                                                <%# DataBinder.Eval(Container.DataItem, "HolidayWork")%>
                                            </td>
                                            <td style="text-align: right;padding-right: 5px">
                                                <%# DataBinder.Eval(Container.DataItem, "AmountActual")%>
                                            </td>
                                            <td style="text-align: left;padding-left: 5px;text-overflow:ellipsis;overflow:hidden;white-space: nowrap;" 
                                                title="<%# DataBinder.Eval(Container.DataItem, "HolidayWorkContent")%>">
                                                <%# DataBinder.Eval(Container.DataItem, "HolidayWorkContent")%>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                                <div id="dPage" class="page" style="width: 60%; margin-top: 10px;white-space:nowrap;">
                                    <span>
                                        <input id="lbnTop" type="button" value="首页" class="commonBut" onclick="TopClick()" /></span>
                                    <span>
                                        <input id="lbnUp" type="button" value="上一页" class="commonBut" onclick="UpClick()" /></span>
                                    <span>
                                        <input id="lbnNext" type="button" value="下一页" class="commonBut" onclick="NextClick()" /></span>
                                    <span>
                                        <input id="lbnEnd" type="button" value="末页" class="commonBut" onclick="EndClick()" /></span>
                                    <span class="disabled">
                                        <asp:Label ID="lbl_L_Di" runat="server" Text="第"></asp:Label>
                                        <asp:Label ID="lbl_ToPage" runat="server" Text="0"></asp:Label>
                                        /
                                        <asp:Label ID="lbl_PageCount" runat="server" Text="0"></asp:Label>
                                        <asp:Label ID="lbl_L_Yie" runat="server" Text="页"></asp:Label></span> <span>
                                            <asp:Label ID="lbl_L_TD" runat="server" Text="跳到"></asp:Label><span class="shoppingnumber">
                                                <asp:TextBox ID="txt_Go" CssClass="logininput" Text="" runat="server" Width="50px"></asp:TextBox>
                                                <%--<asp:RegularExpressionValidator ID="REV_Go" runat="server" ErrorMessage="RegularExpressionValidator"
                                                    Display="Dynamic" ControlToValidate="txt_Go" ValidationExpression="^[1-9]\d*$">*</asp:RegularExpressionValidator>--%>
                                            </span>
                                            <asp:Label ID="lbl_L_Yie2" runat="server" Text="页"></asp:Label></span> <span>
                                                <input id="lbnGo" type="button" value="跳转" class="commonBut" onclick="GoClick()" /></span>
                                </div>
                            
                    </td>
                </tr>
            </table>
            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="ddlQueryType" EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="ddlYearMonth" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
            <div style="display: none;">
                <asp:HiddenField ID="HFQueryType" runat="server" Value="" />
                <asp:HiddenField ID="HFQueryValue" runat="server" Value="" />
                <asp:HiddenField ID="HFYear" runat="server" Value="" />
                <asp:HiddenField ID="HFMonth" runat="server" Value="" />
            </div>
        </div>
    </div>
    </form>
</body>
</html>
